package com.fin.zw.aiqas.entity;

import lombok.Data;
import org.hibernate.annotations.Table;

import javax.persistence.*;

@Entity
@Table(appliesTo = "department",comment="机构信息")
@Data
public class Department extends BaseEntity{

    @Column(columnDefinition = "varchar(100) comment '机构名称'")
    private String name;

    @Column(columnDefinition = "varchar(100) comment '机构编号'")
    private String code;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "parent_id")
    private Department parent;

}
